package util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 李栋
 * @version 1.0.0
 * @className VolatileTest.java
 * @createTime 2021年08月03日 22:06:00
 */
public class VolatileTest {

    private static final Logger logger = LoggerFactory.getLogger(VolatileTest.class);

    // volatile 数组
    volatile int[] num = {1, 2, 3};

    public static void main(String[] args) {
        VolatileTest volatileTest = new VolatileTest();
        volatileTest.showNum();
    }

    public void showNum() {
        for (int i : num) {
            logger.info(String.valueOf(i));
        }
    }


}
